home *** CD-ROM | disk | FTP | other *** search
/ System Booster / System Booster.iso / Archives / ARexxTools / fpl70.lha / bench / decimal.FPL next >
Encoding:
Text File  |  1993-06-15  |  739 b   |  26 lines

  1. /***************************************************************************
  2.  
  3.  **   $Filename: decimal.FPL $
  4.  **   $Release: 5.0 $
  5.  **   $Date: 93/06/15 $
  6.  **
  7.  **   (C) Copyright 1992, 1993 by FrexxWare
  8.  **       All Rights Reserved
  9.  
  10. ****************************************************************************
  11.  
  12.      >>>>>> Frexx Programming Language (FPL) demonstration program <<<<<<
  13.                Author: Daniel Stenberg.
  14.  
  15. ****************************************************************************/
  16.  
  17. int a, b, n, number=getint("Insert maximum number of decimals: ");
  18. string s;
  19. a=getint("Insert left operand: ");
  20. b=getint("Insert right operand: ");
  21. s=itoa(a/b);
  22. if(a%b)
  23.   for(s+=".";n<number;n++)
  24.     s+=itoa((a=a%b*10)/b);
  25. printf("%s\n", s);
  26.